package oop1;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Youkexitong {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        //Youke youke = new Youke();//始终是一个游客
        boolean falg = true;
        while (true) {
            //每次循环，一个新游客
            Youke youke = new Youke();//!!!!
            youke.name = input.next();
            if (youke.name.equals("n")) {
                falg = false;
                break;
            }
            youke.old = input.nextInt();
            if (youke.old > 20) {
                youke.price = 20;
            } else {
                youke.price=0;
                System.out.println("门票免费");
            }
            youke.show();
        }
        System.out.println("退出程序");

    }
}
